< previous page page_265 next page >

Page 265
used to change the properties of the Data control and enhance its capabilities. In fact, setting up and using the Data control requires only three easy steps:
1. Place the Data control on the form.
2. Build the database connection string for the database you want to access.
3. Set the RecordSource property to the SQL query you want to access in the database.
Using the ActiveX Data Control
Because this is probably the first time you have heard about the ActiveX Data control, lets see how to use it to access the Biblio.MDB database that is included with Visual Basic. Start a new project and add the ADODC to the Toolbox using the Components dialog. Now, add the controls in Table 10.1 to the form as shown in Figure 10.1.
TABLE 10.1. ACTIVEX DATA CONTROL DEMO FORM SETUP.
ObjectPropertyValue
ADODCNameadcBooks
TextboxNametxtTitle
DatasourceadcBooks
DataFieldTitle
Command ButtonNamecmdQuit
CaptionQuit
Command ButtonNamecmdNext
CaptionNext
Command ButtonNamecmdPrev
CaptionPrevious

12181-0265a.gif
Figure 10.1.
The ActiveX Data Control
Demo showing the controls to
add to the Form.

 
< previous page page_265 next page >

If you like this book, buy it!